<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>文档</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <style>
    body {
        padding-top: 2rem;
    }

    .header {
        width: 93%;
        height: 2.5rem;
        line-height: 2.5rem;
        padding: 0.5rem 0.8rem;
        text-align: center;
        border-bottom: 1px solid rgb(243, 243, 243, 0.5);
        background-color: #fff;
        position: fixed;
        top:1.5rem;
    }

    .header_img{
      width: 6%;
      height: 45%;
      float: left;
      margin-top: 0.5rem;
    }

    .header_img img {
        width: 100%;
        height: 100%;
    }

    .header h3{
      line-height: 3rem;
      width: 90%;
      text-align: center;
    }
.top_img{
  width: 100%;
  height: 13rem;
  margin-top: 3rem;
}
.top_img img{
  width: 100%;
  height: 100%;
}

.top_imgs{
  width: 100%;
  height: 58%;
}
.top_imgs img{
  width: 100%;
  height: 100%;
}
.footer{
  width: 80%;
  height: 3rem;
  margin: 1rem auto 0rem;
  display: flex;justify-content:space-between;
}
.footer_left{
  width: 50%;
  height: 4rem;
  text-align: center;
}
.left_img{
  width: 26%;
  height: 2.5rem;
  margin-left: 36%;
}
.left_img img{
  width: 100%;
  height: 100%;
}
    </style>
</head>
<body>
  <div class="header">
      <div class="header_img">
          <img src="../image/u18.png" alt="">
      </div>
      <h3>我的作业</h3>
  </div>
  <div class="top_img" id="sp">
    <img src="../image/a18.png" alt="">
  </div>
  <div class="top_imgs">
    <img src="" alt="" id="imgs">
  </div>
  <div class="footer">
    <div class="footer_left" onclick="xzy()">
      <div class="left_img">
        <img src="../image/u12.png" alt="">
      </div>
      <p style="font-size:0.9rem;">上传作业</p>
    </div>

  </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
  <script type="text/javascript" src="../script/common.js"></script>
</html>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.3.js"></script>
<script type="text/javascript">
var id
var userinfo=$api.getStorage('userinfo')
    apiready = function(){
      id = api.pageParam.id

      get_zy()
    };

    function get_zy() {
      var html = ''
      var obj = $api.byId('sp');

      api.ajax({
          url: SITE_URL+'cur_api/zylist/see_zy',
          method: 'post',
          data: {
              values: {
                  id: id
              }
          }
      },function(ret, err){
          if (ret) {
            if(ret.error==200){
              $("#imgs").attr('src',ret.data.imgs)
              html +='<video poster="'+ret.data.img_url+'" src="'+ret.data.videos+'" width="100%" height="100%" controls >'
              html +='</video>'
              $api.html(obj, html);

            }else{
              msgcode('加载出错')
            }
              //alert( JSON.stringify( ret ) );
          } else {
              //alert( JSON.stringify( err ) );
          }
      });

    }

    function xzy() {
      api.openWin({
          name: 'xzy',
          url: './xzy.html',
          pageParam: {
                      id: id,

                  }
      });
    }
</script>
